<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <title>Document</title>
  <style>
    
  </style>
</head>
<body>
  
</body>
<script>

  // const target = "https://www.wanandroid.com/banner/json";
  // const target = "https://www.wanandroid.com/user/login";
  // const target = "https://www.wanandroid.com/user/register";
  const target = "https://www.wanandroid.com/lg/collect/1165/json";
  const data = "{}";
  const method = "post"

  const url = "http://localhost:3000/api?target="+ target +"&method="+ method +"&data=" + data;

  document.onclick = function(){
    const xhr = new XMLHttpRequest();
    xhr.open("get", url);
    xhr.send();
    xhr.onload = function(){
      if(xhr.status === 200){
        // res = JSON.parse(JSON.parse(xhr.responseText).data)
        res = JSON.parse(xhr.responseText)
        console.log(res);
      }
    }
  }

</script>
</html>